//
//  XMHttpTool.h
//  XMWeibo
//
//  Created by chi on 14-8-30.
//  Copyright (c) 2014年 xiaoming. All rights reserved.
//

#import <Foundation/Foundation.h>


#pragma mark - XMHttpFormData
/** FormData模型 */

@interface XMHttpFormData : NSObject

#pragma mark - 属性

@property (nonatomic, strong) NSData *data;

@property (nonatomic, copy) NSString* name;

@property (nonatomic, copy) NSString* fileName;

@property (nonatomic, copy) NSString* mimeType;

#pragma mark - 类工厂方法

+ (instancetype)formData;

@end

#pragma mark - XMHttpTool

@interface XMHttpTool : NSObject


#pragma mark - GET请求
+ (void)httpGetWithURL:(NSString*)url params:(NSDictionary*)params success:(void(^) (id responseObject))success failure:(void (^) (NSError *error))failure;


#pragma mark - POST请求
/**
 *  http post请求，不带上传文件
 */
+ (void)httpPostWithURL:(NSString*)url params:(NSDictionary*)params success:(void(^) (id responseObject))success failure:(void (^) (NSError *error))failure;

/**
 *  http post请求，带上传文件
 */
+ (void)httpPostWithURL:(NSString*)url params:(NSDictionary*)params formDatas:(NSArray*)formDatas success:(void(^) (id responseObject))success failure:(void (^) (NSError *error))failure;

@end
